home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1515 < prev    next >
Encoding:
Text File  |  1996-08-06  |  731 b   |  32 lines

  1. Path: peer-news.britain.eu.net!strath-cs!st-and!pasta!ks2
  2. From: ks2@st-and.ac.uk (Keith Sibson)
  3. Newsgroups: comp.lang.c++
  4. Subject: cout stupidity
  5. Date: 11 Jan 1996 13:06:56 GMT
  6. Organization: University of St. Andrews
  7. Distribution: world
  8. Message-ID: <4d321g$eal@calvin.st-and.ac.uk>
  9. Reply-To: ks2@st-and.ac.uk
  10. NNTP-Posting-Host: pasta.st-and.ac.uk
  11. NNTP-Posting-User: ks2
  12.  
  13.  
  14. #include <iostream.h>
  15.  
  16. int count=10;
  17.  
  18. main()
  19. {
  20.  for(i=0;i<cout;i++) {.....}
  21.  return(0);
  22. }
  23.  
  24. Why does this stupidity compile? (BCC 4.5)
  25.  
  26. Surely cout is of type ostream? Either there is a dubious operator< that 
  27. takes an int and ostream, or there is some wacky automatic conversions going
  28. on. Does an ostream cast to an int that is the stream position?
  29.  
  30. Keith.
  31.  
  32.